const SUPPLIER_FORM_VALID_RULES = {
  enterpriseName: [{ required: true, message: '请输入企业名称', trigger: ['blur', 'change', 'clear'] }],
  legalPerson: [{ required: true, message: '请输入法定代表人', trigger: ['blur', 'change', 'clear'] }],
  regCapital: [{ required: true, message: '请输入注册资本', trigger: ['blur', 'change', 'clear'] }],
  paidInCapital: [{ required: true, message: '请输入实缴资本', trigger: ['blur', 'change', 'clear'] }],
  unifiedSocialCreditCode: [{ required: true, message: '请输入统一社会信用代码', trigger: ['blur', 'change', 'clear'] }],
  organizationCode: [{ required: true, message: '请输入组织机构代码', trigger: ['blur', 'change', 'clear'] }],
  businessRegNumber: [{ required: true, message: '请输入工商注册号', trigger: ['blur', 'change', 'clear'] }],
  taxpayerIdentityNumber: [{ required: true, message: '请输入纳税人识别号', trigger: ['blur', 'change', 'clear'] }],
  enterpriseType: [{ required: true, message: '请输入企业类型', trigger: ['blur', 'change', 'clear'] }],
  belongIndustry: [{ required: true, message: '请输入所属行业', trigger: ['blur', 'change', 'clear'] }],
  belongRegion: [{ required: true, message: '请输入所属地区', trigger: ['blur', 'change', 'clear'] }],
  regAuthority: [{ required: true, message: '请输入登记机关', trigger: ['blur', 'change', 'clear'] }],
  registerAddress: [{ required: true, message: '请输入注册地址', trigger: ['blur', 'change', 'clear'] }],
  businessScope: [{ required: true, message: '请输入经营范围', trigger: ['blur', 'change', 'clear'] }],
  staffSize: [{ required: true, message: '请输入人员规模', trigger: ['blur', 'change', 'clear'] }],
  customerGroups: [{ required: true, message: '请输入客户群体', trigger: ['blur', 'change', 'clear'] }],
  coreRawMaterialName: [{ required: true, message: '请输入核心原材料名称', trigger: ['blur', 'change', 'clear'] }],
  dailyProduction: [{ required: true, message: '请输入日产量', trigger: ['blur', 'change', 'clear'] }],
  mainCategoryCode: [{ required: true, message: '请输入主营品类代码', trigger: ['blur', 'change', 'clear'] }],
  mainProduct: [{ required: true, message: '请输入主营商品', trigger: ['blur', 'change', 'clear'] }],
  competitiveBrand: [{ required: true, message: '请输入竞争品牌', trigger: ['blur', 'change', 'clear'] }],
  advantageousArea: [{ required: true, message: '请输入优势区域', trigger: ['blur', 'change', 'clear'] }],
  supplierName: [{ required: true, message: '请输入供应商名称', trigger: ['blur', 'change', 'clear'] }],
  accountPhone: [{ required: true, message: '请输入协同平台管理手机号' }, {
    type: 'string',
    pattern: /^1\d{10}$/,
    required: true,
    message: '请输入合法11位手机号'
  }],
  // fiscalPeriodDays: [{ required: true, message: '请输入账期天数', trigger: ['blur', 'change', 'clear'] }],
  acceptanceProportion: [{ required: true, message: '请输入验收比例', trigger: ['blur', 'change', 'clear'] }],
  minReturnAmount: [{ required: true, message: '请输入最小退货金额', trigger: ['blur', 'change', 'clear'] }],
  minPurchaseQuantity: [{ required: true, message: '请输入单次最小要货量', trigger: ['blur', 'change', 'clear'] }],
  otherCovenants: [{ required: true, message: '请输入甲乙双方另行约定事项', trigger: ['blur', 'change', 'clear'] }],
  enterpriseSize: [{ required: true, message: '请选择企业规模', trigger: ['blur', 'change', 'clear'] }],
  supplierNature: [{ required: true, message: '请选择供应商性质', trigger: ['blur', 'change', 'clear'] }],
  plantNature: [{ required: true, message: '请选择厂房性质', trigger: ['blur', 'change', 'clear'] }],
  storehouseNature: [{ required: true, message: '请选择库房性质', trigger: ['blur', 'change', 'clear'] }],
  selfPlatform: [{ required: true, message: '请选择自主/第三方平台', trigger: ['blur', 'change', 'clear'] }],
  coordinationType: [{ required: true, message: '请选择协同方式', trigger: ['blur', 'change', 'clear'] }],
  canLease: [{ required: true, message: '请选择是否租赁', trigger: ['blur', 'change', 'clear'] }],
  canOem: [{ required: true, message: '请选择是否代加工', trigger: ['blur', 'change', 'clear'] }],
  brandCountry: [{ required: true, message: '请选择品牌国别', trigger: ['blur', 'change', 'clear'] }],
  directImport: [{ required: true, message: '请选择是否直接进口', trigger: ['blur', 'change', 'clear'] }],
  productGrade: [{ required: true, message: '请选择产品档次', trigger: ['blur', 'change', 'clear'] }],
  brandInfluence: [{ required: true, message: '请选择品牌影响力', trigger: ['blur', 'change', 'clear'] }],
  marketValue: [{ required: true, message: '请选择面价', trigger: ['blur', 'change', 'clear'] }],
  priceControlCycle: [{ required: true, message: '请选择价格管理周期', trigger: ['blur', 'change', 'clear'] }],
  unifiedPrice: [{ required: true, message: '请选择是否全国统一价', trigger: ['blur', 'change', 'clear'] }],
  gainSource: [{ required: true, message: '请选择供应商来源', trigger: ['blur', 'change', 'clear'] }],
  signContract: [{ required: true, message: '请选择是否签合同', trigger: ['blur', 'change', 'clear'] }],
  // lastYearPurchaseAmount: [{ required: true, message: '请输入去年进货额', trigger: ['blur', 'change', 'clear'] }],
  // yearPurchaseAmount: [{ required: true, message: '请输入本年进货额', trigger: ['blur', 'change', 'clear'] }],
  // purchaseAddRatio: [{ required: true, message: '请输入进货涨浮比例', trigger: ['blur', 'change', 'clear'] }],
  supplierLevel: [{ required: true, message: '请选择供应商等级', trigger: ['blur', 'change', 'clear'] }],
  belongDepartment: [{ required: true, message: '请选择供应商归属中心', trigger: ['blur', 'change', 'clear'] }],
  centralPurchase: [{ required: true, message: '请选择是否集采', trigger: ['blur', 'change', 'clear'] }],
  cooperativeClassify: [{ required: true, message: '请选择合作关系分类', trigger: ['blur', 'change', 'clear'] }],
  cooperativeIndustry: [{ required: true, message: '请选择合作行业', trigger: ['blur', 'change', 'clear'] }],
  introductionReason: [{ required: true, message: '请选择引入原因', trigger: ['blur', 'change', 'clear'] }],
  // coordination: [{ required: true, message: '请选择是否线上协同', trigger: ['blur', 'change', 'clear'] }],
  bulkOrderDiscount: [{ required: true, message: '请选择批量订货优惠', trigger: ['blur', 'change', 'clear'] }],
  costCalculation: [{ required: true, message: '请选择成本核算', trigger: ['blur', 'change', 'clear'] }],
  branchOfficeInquiry: [{ required: true, message: '请选择分公司是否可询价', trigger: ['blur', 'change', 'clear'] }],
  branchOfficeOrder: [{ required: true, message: '请选择分公司是否可订货', trigger: ['blur', 'change', 'clear'] }],
  projectFiling: [{ required: true, message: '请选择项目报备', trigger: ['blur', 'change', 'clear'] }],
  rawMaterialOverFloatWarn: [{ required: true, message: '请选择原材料超浮动预警', trigger: ['blur', 'change', 'clear'] }],
  generalTaxpayer: [{ required: true, message: '请选择纳税人类型', trigger: ['blur', 'change', 'clear'] }],
  rollingPrepayment: [{ required: true, message: '请选择是否滚动预付', trigger: ['blur', 'change', 'clear'] }],
  centralizedSettle: [{ required: true, message: '请选择是否集中结账', trigger: ['blur', 'change', 'clear'] }],
  acceptBankRequire: [{ required: true, message: '请选择承兑银行有无要求', trigger: ['blur', 'change', 'clear'] }],
  arrivalTime: [{ required: true, message: '请选择到货时间', trigger: ['blur', 'change', 'clear'] }],
  deliveryPlace: [{ required: true, message: '请选择来货方式', trigger: ['blur', 'change', 'clear'] }],
  handlingStandard: [{ required: true, message: '请选择工装装卸标准', trigger: ['blur', 'change', 'clear'] }],
  purchaseStatus: [{ required: true, message: '请选择进货状态', trigger: ['blur', 'change', 'clear'] }],
  dischargeCargo: [{ required: true, message: '请选择卸货方', trigger: ['blur', 'change', 'clear'] }],
  packingRequire: [{ required: true, message: '请选择包装要求', trigger: ['blur', 'change', 'clear'] }],
  establishmentDate: [{ required: true, message: '请选择成立日期', trigger: ['blur', 'change', 'clear'] }],
  approvalDate: [{ required: true, message: '请选择核准日期', trigger: ['blur', 'change', 'clear'] }],
  mainCategory: [{ required: true, message: '请选择主营品类', trigger: ['blur', 'change', 'clear'] }],
  managementAreaId: [{ required: true, message: '请选择供应商管理区域', trigger: ['blur', 'change', 'clear'] }],
  businessContact: [{ required: true, message: '请选择公司业务对接人', trigger: ['blur', 'change', 'clear'] }],
  expenseInvoice: [{ required: true, message: '请选择是否开费用发票', trigger: ['blur', 'change', 'clear'] }],
  inspectCycle: [{ required: true, message: '请选择考察周期', trigger: ['blur', 'change', 'clear'] }],
  manageCategory: [{ required: true, message: '请选择经营品类' }],
  stockInsurance: [{ required: true, message: '请选择是否库存保价', trigger: ['blur', 'change', 'clear'] }],
  salesChannelArr: [{ required: true, message: '请选择销售渠道', trigger: ['blur', 'change', 'clear'] }],
  // discountTaxRate: [{ required: true, message: '请输入贴息部分补税税率', trigger: ['blur', 'change', 'clear'] }],
}
const SUPPLIER_FORM_VALID_EXT_RULES = {
  // 基本信息
  plantAddress: [{ required: true, message: '请输入厂房地址' }],
  storehouseAddress: [{ required: true, message: '请输入库房地址' }],
  annualOutputValue: [{ required: true, message: '请输入年产值', trigger: ['blur', 'change', 'clear'] }],
  assemblyLineCount: [{ required: true, message: '请输入生产流水线数量', trigger: ['blur', 'change', 'clear'] }],
  equipmentCount: [{ required: true, message: '请输入设备数量', trigger: ['blur', 'change', 'clear'] }],
  oemBrand: [{ required: true, message: '请输入代工品牌', trigger: ['blur', 'change', 'clear'] }],
  oemGrade: [{ required: true, message: '请输入档次', trigger: ['blur', 'change', 'clear'] }],
  // 管理信息
  supplierType: [{ required: true, message: '请选择供应商类型', trigger: ['blur', 'change', 'clear'] }],
  exhibitionName: [{ required: true, message: '请输入展会名称', trigger: ['blur', 'change', 'clear'] }],
  projectFilingContent: [{ required: true, message: '请输入报备内容', trigger: ['blur', 'change', 'clear'] }],
  upstreamSupplier: [{ required: true, message: '请输入上游供应商名称', trigger: ['blur', 'change', 'clear'] }],
  costCalculationFormula: [{ required: true, message: '请上传成本核算公示表', trigger: ['blur', 'change', 'clear'] }],
  upstreamSupplierStandard: [{ required: true, message: '请输入上游供应商合作标准', trigger: ['blur', 'change', 'clear'] }],
  sameTradePriceRatio: [{ required: true, message: '请输入与其他客户价格差率', trigger: ['blur', 'change', 'clear'] }],
  notOpenReason: [{ required: true, message: '请输入不开通原因', trigger: ['blur', 'change', 'clear'] }], // 线上是否协同 否原因

  // 结算信息
  reconciliationDate: [{ required: true, message: '请选择对账日', trigger: ['blur', 'change', 'clear'] }],
  checkoutTime: [{ required: true, message: '请选择结账时间', trigger: ['blur', 'change', 'clear'] }],
  paidType: [{ required: true, message: '请选择付款方式', trigger: ['blur', 'change', 'clear'] }],
  checkoutRange: [{ required: true, message: '请选择结账区间', trigger: ['blur', 'change', 'clear'] }],
  settlementType: [{ required: true, message: '请选择结算方式', trigger: ['blur', 'change', 'clear'] }],
  // creditScale: [{ required: true, message: '请输入信用凭证比例', trigger: ['blur', 'change', 'clear'] }, {
  //   validator: (rule, value, callback) => {
  //     if (Number.isInteger(value)) {
  //       callback()
  //     } else {
  //       callback(new Error('请输入零或正整数！'))
  //     }
  //   },
  //   trigger: ['blur', 'change', 'clear']
  // }],
  // creditTerm: [{ required: true, message: '请输入信用凭证期限', trigger: ['blur', 'change', 'clear'] }, {
  //   validator: (rule, value, callback) => {
  //     if (Number.isInteger(value)) {
  //       callback()
  //     } else {
  //       callback(new Error('请输入零或正整数！'))
  //     }
  //   },
  //   trigger: ['blur', 'change', 'clear']
  // }],
  invoiceType: [{ required: true, message: '请选择发票类型', trigger: ['blur', 'change', 'clear'] }],
  taxBillRate1: [{ required: true, message: '请选择税票率1', trigger: ['blur', 'change', 'clear'] }],
  taxBillRate2: [{ required: true, message: '请选择税票率2', trigger: ['blur', 'change', 'clear'] }],
  taxBillProvideTime: [{ required: true, message: '请选择税票提供时间', trigger: ['blur', 'change', 'clear'] }],
  centralizedSettlePlace: [{ required: true, message: '请选择集中结账地', trigger: ['blur', 'change', 'clear'] }],
  supplyChainFinance: [{ required: true, message: '请选择供应链金融', trigger: ['blur', 'change', 'clear'] }],
  acceptInvoice: [{ required: true, message: '请选择是否承兑', trigger: ['blur', 'change', 'clear'] }],
  acceptRatio: [{ required: true, message: '请选择承兑比例', trigger: ['blur', 'change', 'clear'] }],
  acceptMoney: [{ required: true, message: '请输入承兑金额', trigger: ['blur', 'change', 'clear'] }],
  acceptPeriod: [{ required: true, message: '请选择银行承兑期限', trigger: ['blur', 'change', 'clear'] }],
  commercialAcceptancePeriod: [{ required: true, message: '请输入商业承兑期限', trigger: ['blur', 'change', 'clear'] }],
  taxBillTimeLimit: [{ required: true, message: '请输入税票提供时限', trigger: ['blur', 'change', 'clear'] }],
  taxBillMoneyLimit: [{ required: true, message: '请输入税票提供限额', trigger: ['blur', 'change', 'clear'] }],
  acceptBankRequireRemark: [{ required: true, message: '请上传承兑银行要求描述' }],
  commercialAcceptanceTypeArray: [{ required: true, message: '请选择商业承兑票据类型', trigger: ['blur', 'change', 'clear'] }],
  creditAcceptanceType: [{ required: true, message: '请输入信用票据承兑类型', trigger: ['blur', 'change', 'clear'] }],

  // 财务信息
  // contractStartTime: [{ required: true, message: '请选择合同开始时间', trigger: ['blur', 'change', 'clear'] }],
  // contractEndTime: [{ required: true, message: '请选择合同结束时间', trigger: ['blur', 'change', 'clear'] }],
  // contractType: [{ required: true, message: '请选择合同类型', trigger: ['blur', 'change', 'clear'] }],
  // contractClassify: [{ required: true, message: '请选择合同类别', trigger: ['blur', 'change', 'clear'] }],
  // reconciliation: [{ required: true, message: '请选择是否对账', trigger: ['blur', 'change', 'clear'] }],
  priceIncreaseNotice: [{ required: true, message: '请选择涨价提前通知时间', trigger: ['blur', 'change', 'clear'] }],
  // priceBaseOnRawMaterial: [{ required: true, message: '请选约定价格是否依据原材料进行公式核算', trigger: ['blur', 'change', 'clear'] }],
  // rawMaterialName: [{ required: true, message: '请输入原材料名称', trigger: ['blur', 'change', 'clear'] }],
  // rawMaterialPriceRef: [{ required: true, message: '请输入原材料价格参照方', trigger: ['blur', 'change', 'clear'] }],
  // rawMaterialPriceFloatRate: [{ required: true, message: '请输入原材料价格浮动率', trigger: ['blur', 'change', 'clear'] }],
  // goodsName: [{ required: true, message: '请输入产品名称', trigger: ['blur', 'change', 'clear'] }],
  // goodsPriceFloatRate: [{ required: true, message: '请输入产品价格浮动率', trigger: ['blur', 'change', 'clear'] }],
  cooperativeType: [{ required: true, message: '请选择合作方式', trigger: ['blur', 'change', 'clear'] }],
  cooperationArea: [{ required: true, message: '请选择合作区域', trigger: ['blur', 'change', 'clear'] }],
  cooperativeBrand: [{ required: true, message: '请选择合作品牌', trigger: ['blur', 'change', 'clear'] }],
  salesChannel: [{ required: true, message: '请输入销售渠道', trigger: ['blur', 'change', 'clear'] }],

  // 质保信息
  initialCapitalCollectType: [{ required: true, message: '请选择铺底金收取方式', trigger: ['blur', 'change', 'clear'] }],
  retentionMoney: [{ required: true, message: '请输入质量保证金', trigger: ['blur', 'change', 'clear'] }],
  etcQaExecuteAreaArr: [{ required: true, message: '请选择铺底质保金执行区域', trigger: ['blur', 'change', 'clear'] }],
  otherPackRequirements: [{ required: true, message: '请填写其它包装要求', trigger: ['blur', 'change', 'clear'] }],
  // 返利信息
  rebate: [{ required: true, message: '请选择是否返利', trigger: ['blur', 'change', 'clear'] }],
  monthlyRebateStandard: [{ required: true, message: '请输入月度返利标准', trigger: ['blur', 'change', 'clear'] }],
  monthlyRebateMoneyStep: [{ required: true, message: '请输入月度返利阶梯金额', trigger: ['blur', 'change', 'clear'] }],
  monthlyRebateRatio: [{ required: true, message: '请输入月度返利比例/金额', trigger: ['blur', 'change', 'clear'] }],
  quarterlyRebateStandard: [{ required: true, message: '请输入季度返利标准', trigger: ['blur', 'change', 'clear'] }],
  quarterlyRebateMoneyStep: [{ required: true, message: '请输入季度返利阶梯金额', trigger: ['blur', 'change', 'clear'] }],
  quarterlyRebateRatio: [{ required: true, message: '请输入季度返利比例/金额', trigger: ['blur', 'change', 'clear'] }],
  halfYearRebateStandard: [{ required: true, message: '请输入半年度返利标准', trigger: ['blur', 'change', 'clear'] }],
  halfYearRebateMoneyStep: [{ required: true, message: '请输入半年度返利阶梯金额', trigger: ['blur', 'change', 'clear'] }],
  halfYearRebateRatio: [{ required: true, message: '请输入半年度返利比例/金额', trigger: ['blur', 'change', 'clear'] }],
  yearRebateStandard: [{ required: true, message: '请输入年度返利标准', trigger: ['blur', 'change', 'clear'] }],
  yearRebateMoneyStep: [{ required: true, message: '请输入年度返利阶梯金额', trigger: ['blur', 'change', 'clear'] }],
  yearRebateRatio: [{ required: true, message: '请输入年度返利比例/金额', trigger: ['blur', 'change', 'clear'] }],
  overallRebateRatio: [{ required: true, message: '请输入预计整体返利比例/金额', trigger: ['blur', 'change', 'clear'] }],
  rebateCalculateType: [{ required: true, message: '请选择返利计算方式', trigger: ['blur', 'change', 'clear'] }],
  rebateCalculateLogic: [{ required: true, message: '请选择返利计算逻辑', trigger: ['blur', 'change', 'clear'] }],
  rebateCashType: [{ required: true, message: '请选择返利兑现方式', trigger: ['blur', 'change', 'clear'] }],
  rebateInvoice: [{ required: true, message: '请选择返利是否开票', trigger: ['blur', 'change', 'clear'] }],
  rebateExecuteTime: [{ required: true, message: '请输入返利执行时间', trigger: ['blur', 'change', 'clear'] }],
  rebateCashDays: [{ required: true, message: '请输入年度返利兑现天数', trigger: ['blur', 'change', 'clear'] }],
  rebateCashDaysSeason: [{ required: true, message: '请输入月/季度返利兑现天数', trigger: ['blur', 'change', 'clear'] }],
  includedRebateNextYear: [{ required: true, message: '请选择是否计入来年返利', trigger: ['blur', 'change', 'clear'] }],
  otherRebate: [{ required: true, message: '请输入其他返利条款', trigger: ['blur', 'change', 'clear'] }],

  // 交付信息
  arrivalPeriod: [{ required: true, message: '请输入到货周期', trigger: ['blur', 'change', 'clear'] }, {
    validator: (rule, value, callback) => {
      if (Number.isInteger(value) && value > 0) {
        callback()
      } else {
        callback(new Error('请输入大于0的正整数！'))
      }
    },
    trigger: ['blur', 'change', 'clear']
  }],
  freightPayer: [{ required: true, message: '请选择运费承担方', trigger: ['blur', 'change', 'clear'] }],
  warrantyMonths: [{ required: true, message: '请输入质量保证期', trigger: ['blur', 'change', 'clear'] }],
  substandardGoodsChangeDays: [{ required: true, message: '请输入不符合标准商品调换时间', trigger: ['blur', 'change', 'clear'] }],
  stopPurchaseReason: [{ required: true, message: '请输入停止进货原因', trigger: ['blur', 'change', 'clear'] }],
}
const getRules = () => {
  return Object.assign({}, SUPPLIER_FORM_VALID_RULES)
}
const getExtRules = () => {
  return Object.assign({}, SUPPLIER_FORM_VALID_EXT_RULES)
}
export { getRules, getExtRules }
